<%@ page import="edu.sctu.DataBase" %>
<%@ page import="edu.sctu.User" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: hasee
  Date: 2018/5/20
  Time: 22:44
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--易错点 忘记加taglib指令引入--%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<% request.setCharacterEncoding("UTF-8") ;%>
<html>
<head>
    <title>用户列表</title>
    <style type="text/css">
        table{
            border-collapse: collapse;
        }
        td{
            border: 1px solid #000;
            padding: 10px;
        }
    </style>
</head>
<body>

<button type="button" name="userAdd"><a href="/userAdd.jsp">添加用户</a></button>
<button type="button" name="logout"><a href="/logout">登出</a></button>
<table>
    <tr>
        <td>编号 </td>
        <td>姓名 </td>
        <td>密码 </td>
        <td colspan=2>操作</td>
    </tr>
    <%--易错点 ${userList}少${}--%>
    <c:forEach var="user" items="${userList}">
        <tr>
            <td>${user.id}</td>
            <td>${user.name}</td>
            <td>${user.password}</td>
            <td><a href="/userEdit.jsp?id=${user.id}&username=${user.name}&password=${user.password}">修改</a></td>
            <td><a href="/userDelete?id=${user.id}">删除</a></td>

        </tr>
    </c:forEach>

</table>

</body>
</html>
